package com.wandong.cinema.entity;

import java.util.ArrayList;
import java.util.List;

public class Hall {
    private String hallId;
    private String name;
    private int rowCount;
    private int colCount;
    private String type; // 普通厅、IMAX厅、VIP厅等

    public Hall(String hallId, String name, int rowCount, int colCount, String type) {
        this.hallId = hallId;
        this.name = name;
        this.rowCount = rowCount;
        this.colCount = colCount;
        this.type = type;
    }

    public String getHallId() {
        return hallId;
    }

    public void setHallId(String hallId) {
        this.hallId = hallId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getRowCount() {
        return rowCount;
    }

    public void setRowCount(int rowCount) {
        this.rowCount = rowCount;
    }

    public int getColCount() {
        return colCount;
    }

    public void setColCount(int colCount) {
        this.colCount = colCount;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    // 获取该放映厅的所有座位ID
    public List<String> getAllSeatIds() {
        List<String> seatIds = new ArrayList<>();
        for (int i = 1; i <= rowCount; i++) {
            for (int j = 1; j <= colCount; j++) {
                seatIds.add(hallId + "-" + i + "-" + j);
            }
        }
        return seatIds;
    }

    @Override
    public String toString() {
        return String.format("放映厅ID: %s, 名称: %s, 类型: %s, 座位数: %d行%d列",
                hallId, name, type, rowCount, colCount);
    }
}
